<template>
    <div>
     <p>1. 获取原生DOM元素</p>
    <h1 id="h" ref="myH">我是一个孤独可怜又能吃的🐶</h1>
    <p>2.获取组件对象 - 可调用组件内一切</p>
    <Demo ref="de"></Demo>
    </div>
</template>
<script>
import Demo from"./Child/Demo.vue"
export default {
  mounted() {
    console.log(document.getElementById("h")); // h1
    console.log(this.$refs.myH); // h1
    let demoObj=this.$refs.de;
    demoObj.fn()
  },
  components:{
      Demo
  }
};
</script>
<style>
</style>